/**
 * Created by lingli on 2017/3/10.
 * cnzz文档官网：http://open.cnzz.com/a/new/define/
 */

class cnzz {
	constructor() {
		window._czc = window._czc || [];
		
		//把script标签添加到head里
		let scriptDom = document.createElement( "script" );
		scriptDom.type = "text/javascript";
		scriptDom.src = "https://s95.cnzz.com/z_stat.php?id=1259187207&web_id=1259187207";
		scriptDom.onload = function () {
			console.log( "cnzz成功载入" );
		}
		document.getElementsByTagName( "head" )[ 0 ].appendChild( scriptDom );
	}
	
	pv( currentPage , lastPage ) {
		_czc.push( [ "_trackPageview" , currentPage , lastPage ] );
	}
	
	act( name , appid , action ) {
		_czc.push( [ "_trackEvent" , name , appid , action ] );
	}
}
export default cnzz;